﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ThanhVien.ascx.cs" Inherits="QuanLyDeTaiKHCN.UserControls.ThanhVien" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<asp:UpdatePanel ID="udt1" runat="server">
    <ContentTemplate>
        <div style="width:100%;" class="row-fluid"> <%--class="row-fluid" su dung cai nay de cac span tinh don vi la %--%>
            <div class="control-group info">
                <label class="control-label" style="padding-right: 10px;">Họ và tên</label>
                <div class="controls">
                    <asp:TextBox ID="txtHoTen" runat="server" CssClass="span3" onblur="KiemTraInjection(this);"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldFirstName" Display="Dynamic" ControlToValidate="txtHoTen" runat="server" Text="Nhập họ tên!" ForeColor="Red" ValidationGroup="luu"></asp:RequiredFieldValidator>
                </div>
                <div style="height:5px;"></div>
                <label class="control-label" style="padding-right: 10px;">Phái</label>
                <div class="controls">
                    <fieldset style="padding-left:10px;" class="span3">
                        <asp:RadioButton ID="nam" CssClass="radio inline" runat="server" Checked="true" GroupName="phai" Text="Nam" />
                        <asp:RadioButton ID="nu" CssClass="radio inline" runat="server" GroupName="phai" Text="Nữ" />
                    </fieldset>
                </div>
                <div style="height:5px;clear:both;"></div>
                <label class="control-label" style="padding-right: 10px;">Học hàm, học vị</label>
                <div class="controls">
                    <asp:DropDownList ID="drlHocHamHocVi" runat="server" CssClass="span3 height" onblur="KiemTraInjection(this);"></asp:DropDownList>
                    <asp:RequiredFieldValidator ID="rq3" InitialValue="-1" runat="server" Text="Chọn học hàm, học vị" ValidationGroup="luu" Display="Dynamic"  ForeColor="Red" SetFocusOnError="true" ControlToValidate="drlHocHamHocVi"></asp:RequiredFieldValidator>
                </div>
                <div style="height:5px;"></div>
                <label class="control-label" style="padding-right: 10px;">Chức vụ</label>
                <div class="controls">
                    <asp:DropDownList ID="drlChucVu" runat="server" CssClass="span3 height" onblur="KiemTraInjection(this);"></asp:DropDownList>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator3" InitialValue="-1" runat="server" Text="Chọn chức vụ" ValidationGroup="luu" Display="Dynamic"  ForeColor="Red" SetFocusOnError="true" ControlToValidate="drlChucVu"></asp:RequiredFieldValidator>
                </div>
                <div style="height:5px;"></div>
                <label class="control-label" style="padding-right: 10px;">Lĩnh vực</label>
                <div class="controls">
                    <asp:DropDownList ID="drlLinhVuc" runat="server" CssClass="span3 height" onblur="KiemTraInjection(this);"></asp:DropDownList>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator4" InitialValue="-1" runat="server" Text="Chọn lĩnh vực" ValidationGroup="luu" Display="Dynamic"  ForeColor="Red" SetFocusOnError="true" ControlToValidate="drlLinhVuc"></asp:RequiredFieldValidator>
                </div>
                <div style="height:5px;"></div>
                <label class="control-label" style="padding-right: 10px;">Nơi công tác</label>
                <div class="controls">
                    <asp:TextBox ID="txtNoiCongTac" runat="server" CssClass="span6" onblur="KiemTraInjection(this);"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" Display="Dynamic" ControlToValidate="txtNoiCongTac" runat="server" Text="Nhập nơi công tác!" ForeColor="Red" ValidationGroup="luu"></asp:RequiredFieldValidator>
                </div>
                <div style="height:5px;"></div>
                <label class="control-label" style="padding-right: 10px;">Địa chỉ</label>
                <div class="controls">
                    <asp:TextBox ID="txtDiaChi" runat="server" CssClass="span6" onblur="KiemTraInjection(this);"></asp:TextBox>
                </div>
                <div style="height:5px;"></div>
                <label class="control-label" style="padding-right: 10px;">Điện thoại</label>
                <div class="controls">
                    <asp:TextBox ID="txtDienThoai" runat="server" CssClass="span3" onblur="KiemTraInjection(this);"></asp:TextBox>
                    <ajaxToolkit:FilteredTextBoxExtender ID="txtDienThoai_FilteredTextBoxExtender" runat="server" FilterType="Numbers" TargetControlID="txtDienThoai"></ajaxToolkit:FilteredTextBoxExtender>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" Display="Dynamic" ControlToValidate="txtDienThoai" runat="server" Text="Nhập số điện thoại!" ForeColor="Red" ValidationGroup="luu"></asp:RequiredFieldValidator>
                </div>
                <div style="height:5px;"></div>
                <label class="control-label" style="padding-right: 10px;">Email</label>
                <div class="controls">
                    <asp:TextBox ID="txtEmail" runat="server" CssClass="span3" onblur="KiemTraInjection(this);"></asp:TextBox>
                    <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" Display="Dynamic" ValidationGroup="luu"
                            ErrorMessage="Nhập sai định dạng email" ControlToValidate="txtEmail"
                            SetFocusOnError="True"
                            ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*">
                    </asp:RegularExpressionValidator>
                </div>
                <div style="height:5px;"></div>
                <label class="control-label" style="padding-right: 10px;"></label>
                <div class="controls">
                    <asp:LinkButton ID="LinkButton1" class="btn btn-primary" OnClick="LinkButton1_Click" ValidationGroup="luu"  runat="server"><i class="icon-plus"></i>&nbsp;&nbsp;Thêm</asp:LinkButton>
                    <asp:LinkButton ID="btnsave" class="btn btn-primary" OnClick="btnsave_Click" ValidationGroup="luu"  runat="server"><i class=" icon-save"></i>&nbsp;&nbsp;Lưu</asp:LinkButton>
                    <br /><asp:Label ID="lblstatus" runat="server" ForeColor="Red"></asp:Label>
                    <input type="hidden" runat="server" id="txtid" />
                </div>
            </div>
        </div>
        <div style="width:100%;">
            <asp:GridView ID="grid" runat="server" AutoGenerateColumns="False" DataKeyNames="ID" ForeColor="#333333" GridLines="None" OnRowCommand="grid_RowCommand">
                <AlternatingRowStyle BackColor="White" />
                <Columns>
                    <asp:TemplateField HeaderText="Họ Tên Thành Viên">
                        <ItemTemplate>
                            <asp:Label ID="lblTenLinhVuc" runat="server" Text='<%# Bind("HoTen") %>'></asp:Label>
                        </ItemTemplate>
                        <ItemStyle CssClass="ItemGridCell" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Học hàm, học vị">
                        <ItemTemplate>
                            <%#Eval("HocHamHocVi") %>
                        </ItemTemplate>
                        <ItemStyle CssClass="ItemGridCell" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Chức vụ">
                        <ItemTemplate>
                            <%#Eval("ChucVu") %>
                        </ItemTemplate>
                        <ItemStyle CssClass="ItemGridCell" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Lĩnh vực">
                        <ItemTemplate>
                            <%#Eval("LinhVuc") %>
                        </ItemTemplate>
                        <ItemStyle CssClass="ItemGridCell" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Điện thoại">
                        <ItemTemplate>
                            <%#Eval("DienThoai") %>
                        </ItemTemplate>
                        <ItemStyle CssClass="ItemGridCell" />
                    </asp:TemplateField>
                    <asp:TemplateField ShowHeader="true" HeaderText="Chọn">
                        <ItemTemplate>
                            <asp:LinkButton ID="LinkButtonSelect" runat="server" CausesValidation="False" CommandArgument='<%#Eval("ID") %>' CommandName="SelectMember" Text="<i class='icon-folder-open-alt'></i> Chọn"></asp:LinkButton>
                        </ItemTemplate>
                        <ItemStyle CssClass="ItemGridCell" HorizontalAlign="Center" VerticalAlign="Middle" />
                    </asp:TemplateField>
                    <asp:TemplateField ShowHeader="true" HeaderText="Xóa">
                        <ItemTemplate>
                            <asp:LinkButton ID="LinkButtonDelete" runat="server" CausesValidation="False" OnClientClick="return confirm('Có chắc xóa không!')" CommandArgument='<%#Eval("ID") %>' CommandName="DeleteMember" Text="<i class='icon-remove red'></i> Xóa"></asp:LinkButton>
                        </ItemTemplate>
                        <ItemStyle CssClass="ItemGridCell" HorizontalAlign="Center" VerticalAlign="Middle" />
                    </asp:TemplateField>
                </Columns>
                <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                <RowStyle BackColor="#EFF3FB" />
                <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                <SortedAscendingCellStyle BackColor="#F5F7FB" />
                <SortedAscendingHeaderStyle BackColor="#6D95E1" />
                <SortedDescendingCellStyle BackColor="#E9EBEF" />
                <SortedDescendingHeaderStyle BackColor="#4870BE" />
            </asp:GridView>
        </div>
    </ContentTemplate>
</asp:UpdatePanel>